package com.sxu.data;

import java.util.HashMap;
import java.util.Map;

import com.sxu.entity.Location;
import com.sxu.fileprocess.ReadCSV;
/**
 * 每一个企业对应的经纬度
 * @author FELIX
 *
 */
public class CompanyLocation {
	public static Map<Integer, Location> getCompanyMap(String file) throws Exception {
		Map<Integer, Location> companyMap = new HashMap<Integer, Location>();
		String[][] companyArr = ReadCSV.getCsvData(file);
		//System.out.println("===============companyMap-start================");
		for (int i = 1; i < companyArr.length; i++) {
			Location s = new Location(Float.parseFloat(companyArr[i][2]), Float.parseFloat(companyArr[i][3]));
			//System.out.println("companyID:" + Integer.parseInt(companyArr[i][0]) + " lon:"
			//		+ s.getLon() + " lat:" + s.getLat());
			companyMap.put(Integer.parseInt(companyArr[i][0]), s);
		}
		//System.out.println("===============companyMap-end================");
		return companyMap;
	}
}
